package agent;

import gui.MainFrame;

import java.awt.geom.Line2D;
import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.HashMap;

import behaviour.gui.ReceiveInformationBehaviour;

import jade.core.AID;
import jade.core.Agent;

public class GUIAgent extends Agent {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6922680971742228310L;
	private MainFrame gui;
	private HashMap<AID, Rectangle2D> buildingList;
	private HashMap<AID, Line2D> roadList;
	
	protected void setup() {
		buildingList = new HashMap<AID, Rectangle2D>();
		roadList = new HashMap<AID, Line2D>();
		
		ArrayList<Rectangle2D> buildings = new ArrayList<Rectangle2D>();
		ArrayList<Line2D> roads = new ArrayList<Line2D>();
		
		buildings.addAll(buildingList.values());
		roads.addAll(roadList.values());
		gui = new MainFrame(this, buildings,roads);
		gui.setVisible(true);
		addBehaviour(new ReceiveInformationBehaviour());
	}

	protected void takeDown() {

	}

	public HashMap<AID, Rectangle2D> getBuildingList() {
		return this.buildingList;
	}
	
	public MainFrame getGUI() {
		return this.gui;
	}
}
